package Tests;
import junit.framework.Assert;
import org.junit.Test;
import Core.*;

import org.jmock.Mockery;

import Tests.TestStubs.NeverSatisfiedRequirement;

public class CharacterClassTests
{
	@Test
	public void GetsRequirements()
	{
		Mockery context = new Mockery();
		
		CharacterClass testClass = new CharacterClassImpl();
		final ClassRequirement requirementOne = context.mock(ClassRequirement.class, "requirementOne");
		final ClassRequirement requirementTwo = context.mock(ClassRequirement.class, "requirementTwo");
		
		testClass.addRequirement(1, requirementOne);
		testClass.addRequirement(1, requirementTwo);

		Assert.assertEquals(2, testClass.getRequirementsForLevel(1).size());
	}
	
	@Test
	public void TestsRequirements()
	{
		CharacterClass testClass = new CharacterClassImpl();
		ClassRequirement alwaysFailRequirement = new NeverSatisfiedRequirement();

		testClass.addRequirement(1, alwaysFailRequirement);
		
		Assert.assertEquals(false, testClass.canLevel(null, 1));
	}
}
